package com.manpower.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * MpUserRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_user_role", catalog = "manpower")
public class MpUserRole implements java.io.Serializable {

	// Fields

	private String id;
	private MpUser mpUser;
	private MpRole mpRole;

	// Constructors

	/** default constructor */
	public MpUserRole() {
	}

	/** minimal constructor */
	public MpUserRole(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpUserRole(String id, MpUser mpUser, MpRole mpRole) {
		this.id = id;
		this.mpUser = mpUser;
		this.mpRole = mpRole;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public MpUser getMpUser() {
		return this.mpUser;
	}

	public void setMpUser(MpUser mpUser) {
		this.mpUser = mpUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "role_id")
	public MpRole getMpRole() {
		return this.mpRole;
	}

	public void setMpRole(MpRole mpRole) {
		this.mpRole = mpRole;
	}

}